using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TestApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnTest_Click(object sender, EventArgs e)
        {
            ProjectServerTests.ProjectServer2007ProjPro test = new ProjectServerTests.ProjectServer2007ProjPro(txtURL.Text);
            long ms;
            lbHistory.Items.Clear();
            for (int index = 1; index <= Convert.ToInt32(txtIterations.Text); index++)
            {
                lbHistory.Items.Add("Iteration " + index.ToString());
                ms = test.Open(txtFilename.Text, false);
                //ms = test.New("MyTestProj", false);
                //lbHistory.Items.Add("Open=" + ms.ToString());
                //ms = test.AddTask("Task??");
                //lbHistory.Items.Add("AddTask=" + ms.ToString());
                //ms = test.AddTask("Task??");
                //lbHistory.Items.Add("AddTask=" + ms.ToString());
 //               ms = test.ChangeStartDate("01/01/2007");
 //               lbHistory.Items.Add("ChangeStartDate=" + ms.ToString());
                  //ms = test.ChangeStatusDate("03/19/2007");
                  //lbHistory.Items.Add("ChangeStatusDate=" + ms.ToString());
                  //ms = test.RescheduleProject("03/19/2007");
                  //lbHistory.Items.Add("UpdateProject=" + ms.ToString());
                //ms = test.AddResources(txtFilename.Text, 5, 2);
                //lbHistory.Items.Add("AddResources=" + ms.ToString());

                ms = test.Save(true);
                lbHistory.Items.Add("Save=" + ms.ToString());
                //ms = test.Publish(false, "http://physical:81/20k/");
                ms = test.Publish(false, "", "True");
 //              lbHistory.Items.Add("Publish=" + ms.ToString());
 ////               ms = test.CheckIn();
 ////               lbHistory.Items.Add("CheckIn=" + ms.ToString());
                ms = test.Close(true);
                lbHistory.Items.Add("Close=" + ms.ToString());
 //               lbHistory.Items.Add(" ");
            }
            test.Dispose();
        }
    }
}